]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
st-icon: Fix potential crash involving shadows
authorJasper St. Pierre <jstpierre@mecheye.net>
Thu, 12 Jul 2012 00:26:11 +0000 (20:26 -0400)
committerJasper St. Pierre <jstpierre@mecheye.net>
Thu, 12 Jul 2012 01:08:53 +0000 (21:08 -0400)
If the icon is painted before the new shadow is around, a stale
shadow material will be painted with a NULL shadow spec, resulting
in a crash.

https://bugzilla.gnome.org/show_bug.cgi?id=679776

src/st/st-icon.c

index 9c2ac5e91423f926f3cbd395cadee51aaa47ccab..ff75d32ecca6b662cb45d9b4bbc644ba4b1bf22c 100644 (file)
@@ -302,6 +302,13 @@ st_icon_style_changed (StWidget *widget)
       st_shadow_unref (priv->shadow_spec);
       priv->shadow_spec = NULL;
     }
+
+  if (priv->shadow_material)
+    {
+      cogl_handle_unref (priv->shadow_material);
+      priv->shadow_material = COGL_INVALID_HANDLE;
+    }
+
   priv->shadow_spec = st_theme_node_get_shadow (theme_node, "icon-shadow");
 
   if (priv->shadow_spec && priv->shadow_spec->inset)